//
// Created by lyc on 2025/2/23.
//
#include "3n+1.cpp"
#include <ctime>
#include <iomanip>

void runTest(){
    int sum;
    for(int i = 0; i < 1000; i++)
        for(int j = 0; j < 1000; j++)
            for(int z = 0; z < 10000; z++)
                sum = i + j + z;
}

void algorithm4(){
    // 运行时间(单位:s) = （运行前clock tick - 运行后clock tick）/ 每秒tick数
    int tick1 = clock();
    runTest();
    int tick2 = clock();

    int time = (tick2 - tick1) / CLK_TCK;

    // 调整输出格式
    int time_h, time_m, time_s;
    time_h = time / 3600;
    time_m = (time - 3600 * time_h) / 60;
    time_s = time - time_h * 3600 - time_m * 60;
    cout << "runTime : " << setfill('0') << setw(2) << time_h
         << ":" << setfill('0') << setw(2) << time_m
         << ":" << setfill('0') << setw(2) << time_s << endl;
    cout << time << endl;
}